import { createSlice } from "@reduxjs/toolkit";
import rang from '../../apis/modules/rang'
export const rangeSlice=createSlice({
    name:'range',
    initialState:{
        data:{}
    },
    reducers:{
        setData(state,action){
            state.data=action.payload
        }
    }
})
export const randerRangeData=(val)=>{
    return async (dispatch)=>{
      let res= await rang.findRangById(val)
      console.log(res);
      dispatch(rangeSlice.actions.setData(res.data.data))
    }
}